package com.schoolcloud.system.mapper;


import com.schoolcloud.system.entity.SysPermission;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author hongmizfb
 * @description 针对表【sys_permission】的数据库操作Mapper
 * @createDate 2024-10-19 23:02:28
 * @Entity .entity.SysPermission
 */
@Mapper
public interface SysPermissionMapper {
    /**
     * 新增一个权限
     *
     * @param permission 权限实体类
     */
    void addPermission(SysPermission permission);

    /**
     * 根据条件查询权限
     *
     * @param sysPermission
     * @return {@link List}<{@link SysPermission}>
     */
    List<SysPermission> list(SysPermission sysPermission);

    /**
     * 查询所有的权限
     *
     * @return {@link List}<{@link SysPermission}>
     */
    List<SysPermission> all();

    List<String> getUserPermissionsCode(String userId);

    List<String> listCode(String userId);

    List<SysPermission> getMenuByUserId(String userId);

    /**获取非功能（按钮）权限的数据
     * @return {@link List}<{@link SysPermission}>
     */
    List<SysPermission> getPermissionFolder();

    void modifyPermission(SysPermission permission);

    void delSysPermissionById(String permissionId);

    List<SysPermission> getPermissionsByRoleId(String roleId);

    SysPermission getPermissionById(String permissionId);
}
